package com.tsf.demo.consumer.controller;

import com.tsf.demo.commons.vo.Product;
import com.tsf.demo.consumer.entity.CustomMetadata;
import com.tsf.demo.consumer.proxy.MeshUserService;
import com.tsf.demo.consumer.proxy.OrderService;
import com.tsf.demo.consumer.proxy.ProviderDemoService;
import com.tsf.demo.consumer.proxy.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.tsf.core.TsfContext;
import org.springframework.util.StringUtils;
import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.AsyncRestTemplate;
import org.springframework.web.client.RestTemplate;

@RestController
public class OrderController {

	@Autowired
	private ProviderDemoService providerDemoService;
	@Autowired
	private OrderService orderService;

	//查询库存
	@RequestMapping(value = "/product/{id}", method = RequestMethod.GET)
	public Product getProduct(@PathVariable String id) {
		return providerDemoService.getProduct(id);
	}

	//查询库存
	@RequestMapping(value = "/product2/{id}", method = RequestMethod.GET)
	public Product getProduct2(@PathVariable String id) {
		return orderService.getProduct(id);
	}

}